#!/bin/bash

password=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 12`
docker run \
  -d -p 3306:3306 --name mysql \
  -v/opt/docker-data/mysql/data:/var/lib/mysql \
  -e MYSQL_ROOT_PASSWORD=$password \
  mysql:8

echo "passwod: $password" > mysql.txt